package com.aerozhonghuan.logisticsmall.modules.cart.logic;

import android.content.Context;

import com.aerozhonghuan.logisticsmall.framework.base.URLs;
import com.aerozhonghuan.logisticsmall.modules.cart.beans.CbInfo;
import com.aerozhonghuan.logisticsmall.widget.ProgressDialogIndicator;
import com.aerozhonghuan.oknet2.CommonCallback;
import com.aerozhonghuan.oknet2.RequestBuilder;
import com.google.gson.reflect.TypeToken;

/**
 * Created by ChenLin on 2019/5/24 13:59.Email&WeChat:7877409@163.com
 */
public class CartInfoRequest {

    public static void cb(int totalPrice, String products, Context context,
                          ProgressDialogIndicator dialog, CommonCallback<CbInfo> callback) {
        TypeToken<CbInfo> type = new TypeToken<CbInfo>() {
        };
        callback.setResponseType(type);
        RequestBuilder.with(context)
                .URL(URLs.CB)
                .progress(dialog)
                .para("totalPrice", totalPrice)
                .para("products", products)
                .onSuccess(callback).excute();
    }
}
